#include "PDTNeg.h"
#include "PDTCodeGraph.h"
#include "PDTZ3GraphVisitor.h"

PDTNeg::PDTNeg(PDTCodeGraph & CG, PDTExpNum &operand) :
  PDTExpNumUn(CG, operand)
{
}

Z3_ast
PDTNeg::Z3NodeVisit (PDTZ3Visitor &ZV)
{
  if (Z3node != NULL)
    return Z3node;

  Z3_ast child = children[0]->Z3visit(ZV);
  Z3node = Z3_mk_unary_minus(ZV.ctx, child);

  return Z3node;
}
